# -*- coding: UTF-8 -*-

from dtrader.order import BaseOrder


class AshareOrder(BaseOrder):

    def __init__(self, ticker, action, price,quantity=0):
        """
        订单购买的数据量初始化为0，PositionSizer会设置订单数量，然后发送订单到
        风险控制模块生成订单事件

        Parameters:
        ticker - 交易代码, e.g. 'AU1707'.
        action - 'BOT' (多) or 'SLD' (空).
        quantity - 交易的股数.
        """
        quantity = quantity // 100 *100
        self.ticker = ticker
        self.action = action
        self.quantity = quantity
        self.price = price